<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<div id="main" style="width: 600px;height: 400px">
</div>
</body>
<script src="../echarts/dist/echarts.min.js"></script>
<script>
    var mychart=echarts.init(document.getElementById('main'));
    //制定图表的配置项和数据===
    var option={
        title:{
            text:'echarts 入门示例'//左上角标题
        },
        tooltip:{},
        legend:{
            data:['销量']//指示条
        },
        xAxis:{
            data:['衬衫','羊毛衫','雪纺衫','裤子','高跟鞋','袜子']//坐标系X轴的相应名字
        },
        yAxis:{},
        series:[{//设置竖条的相应属性====
            name:'销量',
            type:'bar',
            data:[10,20,30,40,50,20]
        }]
    }
    mychart.setOption(option);//位置调用相应的配置=========

    mychart.on('click',function(params){
        alert(params.name);
    })
</script>
</html>